package com.site.dao.impl.dining;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.site.dao.dining.BanquetHallDao;
import com.site.dto.dining.BanquetHallBizBean;
import com.site.model.dining.BanquetHallInfo;
import com.site.util.base.dao.BaseDaoImpl;
import com.site.util.extremetable.QueryPage;

/**
 * 宴会厅Dao
 * @author win7
 *
 */
@Repository
public class BanquetHallDaoImpl extends BaseDaoImpl implements BanquetHallDao {

	@Override
	public List<BanquetHallInfo> getBanquetHalls(QueryPage queryPage,
			BanquetHallBizBean banquetHallBizBean) {
		String hql = "from BanquetHallInfo where 1 = 1 ";
		Map<String, Object> map = new HashMap<String, Object>();
		
		if(banquetHallBizBean != null){
			if(banquetHallBizBean.getRid() != null){
				hql += " and rid = :rid ";
				map.put("rid", banquetHallBizBean.getRid());	
			}
		}
		if(queryPage == null){
			return super.findByHQL(hql, map);
		} else {
			return super.findByHQL(queryPage,hql, map,false);
		}
	}

}
